import type { Equal, Expect } from "@type-challenges/utils";

type cases = [
  Expect<Equal<MyExclude<"a" | "b" | "c", "a">, "b" | "c">>,
  Expect<Equal<MyExclude<"a" | "b" | "c", "a" | "b">, "c">>,
  Expect<
    Equal<MyExclude<string | number | (() => void), Function>, string | number>
  >
];

type TestExclude<T, U> = T extends U ? never : T;
type T1 = TestExclude<"a" | "b" | "c", "a">; //  "b" | "c"
type T2 = TestExclude<"a" | "b" | "c", "a" | "b">; //  "c"

// extends理解
// T = a  b  c
// U = a
/**
 * T extends U 对比是不是相等
 * a -> a 结果是 never 就是不会有的类型
 * b -> a 结果是 T 也就是 b
 * c -> a 结果是 T 也就是 c
 *
 * 当 U = a  b 是 也是一一对比 对了一轮对比
 * a -> b = a
 * b -> b = never
 * c -> b = c
 *
 */
